<template>
  <div class="close">
    <avue-crud
      ref="crud"
      style="width:100%"
      :data="loadData"
      :option="tableOption"
      :table-loading="loading"
    >
    <template slot-scope="scope" slot="indexLabel">
        <span>{{scope.row.$index+(page.current - 1) * page.size + 1}}</span>
      </template>
    <template slot="saleScope" slot-scope="scope">
        <span>{{(scope.row.couponShopId && scope.row.couponGoodsId)?'平台':(scope.row.couponShopId?'门店':(scope.row.couponGoodsId?'商品':''))}}</span>
      </template>
      <template slot="menu" slot-scope="scope">
        <!-- <el-button @click="peidan(scope.row)" type="text" icon="el-icon-s-management">配单</el-button>
        <el-button @click="del(scope.row)" type="text" icon="el-icon-document-delete">作废</el-button> -->
        <el-button @click="details(scope.row)" type="text" icon="el-icon-view">详情</el-button>
      </template>
    </avue-crud>
    <template>
      <div style="width:100%;position:relative;height:100px">
        <el-pagination
          :page-sizes="[10, 20,30,40, 50, 100]"
          :pager-count="7"
          :current-page="page.current"
          :page-size="page.size"
          :total="page.total"
          layout="total, sizes, prev, pager, next, jumper"
          style="margin:2% 0;position:absolute;right:1%"
          background
          @size-change="sizeChange"
          @current-change="currentChange"
        ></el-pagination>
      </div>
    </template>
  </div>
</template>

<script src='./close.js'></script>

<style lang="scss">
.close {
  margin: 10px 0px;
}
</style>